package com.rem.chat.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserContactApplyStatusEnum {
    INIT(0, "待处理"),
    PASS(1, "已同意"),
    REJECT(2, "已拒绝"),
    BLACKLIST(3, "已拉黑");

    private final Integer status;
    private final String desc;

    public static UserContactApplyStatusEnum getByStatus(Integer status) {
        try {
            for (UserContactApplyStatusEnum item: UserContactApplyStatusEnum.values()) {
                if (status.equals(item.getStatus())) {
                    return item;
                }
            }
            return null;
        } catch (Exception e) {
            return null;
        }
    }
}
